﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Templates/DefaultMaster.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Templates_Register_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:Panel ID="pnlLoggedIn" runat="server">
    <h1><asp:Image ID="Image2" ImageUrl="~/dbimages/h1-login.gif" AlternateText="Log In" runat="server" /></h1>
        <p>You have already logged in as <asp:LoginName ID="loggedInName" runat="server" />.</p>
    </asp:Panel>
    
    <asp:Panel ID="pnlLogin" CssClass="form" runat="server">
        <h1><asp:Image ImageUrl="~/dbimages/h1-login.gif" AlternateText="Log In" runat="server" /></h1>
        <acms:UserLogonControl ID="login" runat="server" />
    <p>&nbsp;</p>
    </asp:Panel>
    
    <asp:Panel ID="pnlRegister" DefaultButton="btnEnter" CssClass="form" runat="server">
       
       <h1><asp:Image ID="Image1" ImageUrl="~/dbimages/h1-registeryourschool.gif" AlternateText="Register Your School" runat="server" /></h1>
        
        <asp:ValidationSummary ID="valSummary" runat="server" DisplayMode="BulletList" HeaderText="Please correct the following errors and try again."
            ShowSummary="False" ShowMessageBox="True" />
            <asp:Panel ID="pnlErrors" CssClass="errorBox" Visible="false" EnableViewState="false" runat="server">
                <ul id="ulErrors" runat="server">
                </ul>
            </asp:Panel>
        <ul class="form">
            <li class="title first">
                <span class="formLabel">School Details</span>
            </li>
            
            <li class="formItem">
                <span class="formLabel">
                <asp:Label ID="Label13" Text="School Name:" AssociatedControlID="txtSchoolName"
                    runat="server" />
                <span style="color:Red">*</span>
                </span>
                <span class="forminput">
                    <asp:TextBox ID="txtSchoolName" runat="server" />
                    <asp:RequiredFieldValidator ID="valSchoolName" ErrorMessage="School Name is required"
                        ControlToValidate="txtSchoolName" Display="Dynamic" runat="server" />
                </span>
            </li>
            
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label1" Text="School Type:" AssociatedControlID="ddlType"
                    runat="server" /><span style="color:Red">*</span>
                </span>
                <span class="forminput">
                    <asp:DropDownList ID="ddlType" runat="server">
                        <asp:ListItem Text="" Value="" />
                        <asp:ListItem Text="Primary" Value="Primary" />
                        <asp:ListItem Text="Middle" Value="Middle" />
                        <asp:ListItem Text="Secondary" Value="Secondary" />
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="valType" ErrorMessage="School Type is required" ControlToValidate="ddlType" Display="Dynamic" runat="server" />
                </span></li>
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label2" Text="Address:" AssociatedControlID="txtAddress1"
                    runat="server" />
                    <span style="color:Red">*</span>
                </span>
                <span class="forminput">
                    <asp:TextBox ID="txtAddress1" runat="server" />
                    <asp:RequiredFieldValidator ID="valAddress1" ErrorMessage="School Address is required"
                        ControlToValidate="txtAddress1" Display="Dynamic" runat="server" />
                </span>
            </li>
            <li class="formItem">
                <span class="forminput">
                    <asp:TextBox ID="txtAddress2" runat="server" />
                </span>
            </li>
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label3" Text="Town:" AssociatedControlID="txtTown"
                    runat="server" />
                    <span style="color:Red">*</span>
                </span>
                <span class="forminput">
                    <asp:TextBox ID="txtTown" runat="server" />
                    <asp:RequiredFieldValidator ID="valTown" ErrorMessage="School Town is required" ControlToValidate="txtTown"
                        Display="Dynamic" runat="server" />
                </span>
            </li>
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label14" Text="County:" AssociatedControlID="txtCounty"
                    runat="server" />
                </span>
                <span class="forminput">
                    <asp:TextBox ID="txtCounty" runat="server" />
                </span>
            </li>
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label4" Text="Post Code:" AssociatedControlID="txtTown"
                    runat="server" />
                    <span style="color:Red">*</span>
                </span>
                <span class="forminput">
                    <asp:TextBox ID="txtPostCode" runat="server" />
                    <asp:RequiredFieldValidator ID="valPostCode" ErrorMessage="School Post Code is required"
                        ControlToValidate="txtPostCode" Display="Dynamic" runat="server" />
                    <asp:RegularExpressionValidator ID="valPostCodeFormat" ControlToValidate="txtPostCode" ErrorMessage="Invalid Post Code" Display="Dynamic" runat="server" />
                </span>
            </li>
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label5" Text="School Tel:" AssociatedControlID="txtTown"
                    runat="server" />
                    <span style="color:Red">*</span>
                </span>
                <span class="forminput">
                    <asp:TextBox ID="txtSchoolTel" runat="server" />
                    <asp:RequiredFieldValidator ID="valSchoolTel" ErrorMessage="School Telehone Number is required"
                        ControlToValidate="txtSchoolTel" Display="Dynamic" runat="server" />
                </span>
            </li>
            <li class="title">
                <span class="formLabel">Main Contact</span>
            </li>
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label6" Text="First Name:" AssociatedControlID="txtContactFirstName"
                    runat="server" />
                    <span style="color:Red">*</span>
               </span>
                <span class="forminput">
                    <asp:TextBox ID="txtContactFirstName" runat="server" />
                    <asp:RequiredFieldValidator ID="valContactFirstName" ErrorMessage="Main Contact First Name is required"
                        ControlToValidate="txtContactFirstName" Display="Dynamic" runat="server" />
                </span></li>
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label7" Text="Last Name:" AssociatedControlID="txtContactLastName"
                    runat="server" />
                    <span style="color:Red">*</span>
                </span>
                <span class="forminput">
                    <asp:TextBox ID="txtContactLastName" runat="server" />
                    <asp:RequiredFieldValidator ID="valContactLastName" ErrorMessage="Main Contact Last Name is required"
                        ControlToValidate="txtContactLastName" Display="Dynamic" runat="server" />
                </span>
            </li>
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label8" Text="Email Address:" AssociatedControlID="txtContactLastName"
                    runat="server" />
                    (Please enter a frequently used address)
                    <span style="color:Red">* </span>
                </span>
                <span class="forminput">
                    <asp:TextBox ID="txtEmailAddress" runat="server" />
                    <asp:RequiredFieldValidator ID="valEmailAddress" ErrorMessage="Main Contact Email Address is required"
                        ControlToValidate="txtEmailAddress" Display="Dynamic" runat="server" />
                    <asp:RegularExpressionValidator ID="valEmailAddressFormat" ControlToValidate="txtEmailAddress" ErrorMessage="Invalid Email Address" Display="Dynamic" runat="server" />
                </span>
            </li>
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label9" AssociatedControlID="txtContactTel" Text="Contact Tel:" runat="server" /> (if different from school)</span> <span class="forminput">
                    <asp:TextBox ID="txtContactTel" runat="server" />
                </span>
            </li>
            <li class="title">
                <span class="formLabel">Secondary Contact</span>
            </li>
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label10" Text="Name:" AssociatedControlID="txtSecondaryContact"
                    runat="server" />
                </span>
                <span class="forminput">
                    <asp:TextBox ID="txtSecondaryContact" runat="server" />
                </span>
            </li>
            <li class="title">
                <span class="formLabel">Login</span>
            </li>
            <li class="formItem">
                <asp:Label ID="Label15" CssClass="formLabel" Text="Username:" AssociatedControlID="txtUsername"
                    runat="server" />- must contain between 5 and 14 alphanumeric characters<span style="color:Red">*</span>
                <span class="input">
                    <asp:TextBox ID="txtUsername" runat="server" />
                    <asp:RequiredFieldValidator ID="valUsernameReq" ErrorMessage="Username Required" ControlToValidate="txtUsername"
                        Display="Dynamic" runat="server" />
                    <asp:RegularExpressionValidator ID="valUsernameFormat" ControlToValidate="txtUsername" ErrorMessage="Username must be between 5 and 14 characters, must start and end with a alphanumeric character and cannot contain spaces." ValidationExpression="^[a-zA-Z0-9]{1}[a-zA-Z0-9\S]{3,12}[a-zA-Z0-9]{1}$" Display="Dynamic" runat="server" />
                </span></li>
            <li class="formItem">
                <asp:Label ID="Label11" CssClass="formLabel" Text="Password:" AssociatedControlID="txtPassword"
                    runat="server" />- must contain between 5 and 14 alphanumeric characters<span style="color:Red">*</span>
                <span class="input">
                    <asp:TextBox ID="txtPassword" TextMode="Password" runat="server" />
                    <asp:RequiredFieldValidator ID="valPassword" ErrorMessage="Password Required" ControlToValidate="txtPassword"
                        Display="Dynamic" runat="server" />
                    <asp:RegularExpressionValidator ID="valPasswordFormat" ControlToValidate="txtPassword" ValidationExpression="^[a-zA-Z][\S]{4,13}$" ErrorMessage="Password must start with a letter and be between 5 and 14 characters. No spaces are allowed." Display="Dynamic" runat="server" />
                </span></li>
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label12" Text="Confirm Password:" AssociatedControlID="txtConfirmPassword"
                    runat="server" />
                    <span style="color:Red">*</span>
                </span>
                <span class="forminput">
                    <asp:TextBox ID="txtConfirmPassword" TextMode="Password" runat="server" />
                    <asp:RequiredFieldValidator ID="valConfirmPassword" ErrorMessage="Confirm Password Required"
                        ControlToValidate="txtConfirmPassword" Display="Dynamic" runat="server" />
                    <asp:CompareValidator ID="valComparePassword" runat="server" ErrorMessage="Passwords do not match"
                        ControlToCompare="txtPassword" ControlToValidate="txtConfirmPassword"></asp:CompareValidator>
                </span>
            </li>
            
            <li class="formItem">
                <span style="color:Red">*</span> = Compulsory Field
            </li>
            
            <li class="formItem buttons"><span class="forminput">
                <asp:Button ID="btnEnter" Text="Enter" runat="server" OnClick="btnEnter_Click" />
            </span></li>
        </ul>
    </asp:Panel>
    <asp:Panel ID="pnlEntry" Visible="false" runat="server">
       <h1><asp:Image ID="Image3" ImageUrl="~/dbimages/h1-registeryourschool.gif" AlternateText="Register Your School" runat="server" /></h1>
        <p>Thank you for registering with the Norwich Union Climate Change Champions project.</p>
        <p>You are now able to access the Educational Resources and Carbon Calculator found in the “My School” section of the website. You can access “My School” via the main menu, logging in with the User Name and Password you chose.</p>
        <p>If you have any questions please contact: <asp:HyperLink ID="HyperLink1" NavigateUrl="mailto:climatechangechampions@globalactionplan.org.uk" runat="server">climatechangechampions@globalactionplan.org.uk</asp:HyperLink></p>
        <p><asp:Hyperlink ID="lnkContinue" text="Click here to continue" runat="server" /></p>
    </asp:Panel>
</asp:Content>

